﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Vici.Mvc;
using SSO.Model;
namespace SSO
{
    public class SsoMange : AdminController
    {
        [View("admin/sso/ssomange")]
        [Url("admin/sso/ssomange")]
        public void Run()
        {
            ViewData["PageTitle"] = "SSO管理中心";
        }
        [Url("admin/sso/getsitelist")]
        public void GetSiteList()
        {
            Response.Write(Site.EasySortPage("ID", "SiteName", "SiteAdd", "Group", "CreateUser", "CreateDate"));
            Response.End();
        }
        [Url("admin/sso/saveSite")]
        public void SaveSite()
        {
            int id = Request["ID"] != null ? int.Parse(Request["ID"].ToString()) : 0;
            Site.GridSave(id);
        }
        [Url("admin/sso/delSite")]
        public void DelSite()
        {
            Site.Read(int.Parse(Request["ID"])).Delete();
        }
    }
}